<?php

namespace app\admin\model\sales;

use think\Model;

/**
 * Cogsglpostings
 */
class Cogsglpostings extends Model
{
    // 表名
    protected $name = 'sales_cogsglpostings';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;


    public function areaTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\sales\Areas::class, 'area', 'areacode');
    }

    public function stkcatTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\stock\Stockcategory::class, 'stkcat', 'categoryid');
    }

    public function glcodeTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'glcode', 'accountcode');
    }

    public function salestypeTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\sales\Salestypes::class, 'salestype', 'typeabbrev');
    }
}